package net.chasing.androidbaseconfig.util;

import com.hwangjr.rxbus.RxBus;

public class RxBusUtils {
    public static void register(Object obj) {
        try {
            if (!RxBus.get().hasRegistered(obj))
                RxBus.get().register(obj);
        } catch (Exception ignored) {
        }
    }

    public static void unregister(Object obj){
        try {
            if (RxBus.get().hasRegistered(obj))
                RxBus.get().unregister(obj);
        } catch (Exception ignored) {
        }
    }

    public static void post(String key, Object obj){
        RxBus.get().post(key, obj);
    }
}
